local tuilang = fk.CreateSkill({
    name = "sj3__tuilang",
})
  
Fk:loadTranslationTable{
  ["sj3__tuilang"] = "推浪",
  [":sj3__tuilang"] = "当你失去过的总牌数变为3的整倍数时，你可以摸两张牌，然后弃置任意张牌。",

  ["@sj3__tuilang"] = "推浪",
  ["#sj3__tuilang"] = "推浪：你可以弃置任意张牌",

  ["$sj3__tuilang1"] = "激流勇进，乘帆破浪！",
  ["$sj3__tuilang2"] = "洄旋逆转，定克惊涛！",
}

  tuilang:addEffect(fk.AfterCardsMove, {
    anim_type = "drawcard",
    can_trigger = function(self, event, target, player, data)
      if player:hasSkill(tuilang.name) then
        for _, move in ipairs(data) do
          if move.from == player then
            for _, info in ipairs(move.moveInfo) do
              if info.fromArea == Card.PlayerHand or info.fromArea == Card.PlayerEquip then
                local m = player:getMark("@sj3__tuilang")
                return (m % 3 == 0) and m > 0
              end
            end
          end
        end
      end
    end,
    on_cost = function (self, event, target, player, data)
      return player.room:askToSkillInvoke(player,{skill_name = tuilang.name})
    end,
    on_use = function(self, event, target, player, data)
      local room = player.room
      room:drawCards(player,2,tuilang.name)
      room:askToDiscard(player,{
        min_num = 1,
        max_num = 999,
        skill_name = tuilang.name,
        prompt = "#sj3__tuilang",
        include_equip = true,
      })
    end,
    can_refresh = function(self, event, target, player, data)
      if player:hasSkill(tuilang.name,true) then
        for _, move in ipairs(data) do
          if move.from == player then
            event:setCostData(self,{
            n = #table.filter(move.moveInfo,function (info)
              return info.fromArea == Card.PlayerHand or info.fromArea == Card.PlayerEquip
            end)})
            return true
          end
        end
      end
    end,
    on_refresh = function (self, event, target, player, data)
      player.room:addPlayerMark(player,"@sj3__tuilang",event:getCostData(self).n)
    end,
  })

  return tuilang